-
Couldn't load subscription status.
- Fork 4
Add more common operations to Quantity
#10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is safe to provide for every quantity and brings it closer to a regular `float`, which means they can be used in generic code. Signed-off-by: Leandro Lucarella <[email protected]>
This is safe to provide for every quantity and brings it closer to a regular `float`, which means they can be used in generic code. Signed-off-by: Leandro Lucarella <[email protected]>
This is safe to provide for every quantity and brings it closer to a regular `float`, which means they can be used in generic code. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
|
Enabled auto-merge. |
| Returns: | ||
| This quantity. | ||
| """ | ||
| return self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blankline after function?
| Returns: | ||
| The rounded quantity. | ||
| """ | ||
| return self._new(round(self._base_value, ndigits)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blankline after function?
| @pytest.mark.parametrize("ndigits", [0, 1, 2, 3]) | ||
| def test_round(value: float, ndigits: int) -> None: | ||
| """Test the rounding of the quantities.""" | ||
| assert round(Quantity(value), ndigits) == Quantity(round(value, ndigits)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a blnak line here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it seems the blanklines are correct after all, you just distributed the correct blankline-diffs over different commits
|
Oh, I guess the "stage these lines" from |
This was extracted from frequenz-floss/frequenz-sdk-python@fba4af6.